#ifndef __CONTEXT__H__
#define __CONTEXT__H__

#include <vector>
#include <map>
#include <string>
#include <SymbolTable.h>
#include <netthumb.h>
#include <netthumbVisitor.h>

namespace netthumb {
  
  class Driver;

  class ContextI: public NetthumbVisitor {

  private:

    map<int, string> _attrMap;
    vector<ConfRouteI*> _confRouteVector;
    map<string, DeviceI*> _deviceMap;
    RouteI* _route;
    SymbolTable& _symbolTable;
    Driver* _driver;

  public:
    ContextI(SymbolTable& sTable);
    SymbolTable* getSymbolTablePtr();
    void setDriver(Driver* drv);
    void insertAttribute(int key, string val);
    void visit(SymbolTable* stable);
    void visit(ConfRouteI* conf);
    void visit(DeviceI* device);
    void visit(RouteI* route);
    void visit(HostI* host);
    void visit(RouterI* router);
    void visit(NetworkI* network);

  private:
    bool checkNetInDevices(SymbolTable* stable);
    bool checkNetInRoutes(SymbolTable* stable);
  };
}

#endif
